Skip to content

fix(release): address feature-freeze automation review follow-ups - #8360

Open
fr4nc1sc0-r4m0n wants to merge 2 commits into
elastic:mainfrom
fr4nc1sc0-r4m0n:fix/release-automation-review-followups
Open

fr4nc1sc0-r4m0n wants to merge 2 commits into
elastic:mainfrom
fr4nc1sc0-r4m0n:fix/release-automation-review-followups

Conversation

@fr4nc1sc0-r4m0n

Copy link
Copy Markdown
Contributor

Motivation

Copilot review on the 9.4 backport of the feature-freeze Mage work (#8331) called out several real bugs that are also present on main after #7339. Fixing them here first gives a clean cherry-pick for the backport lines instead of patching conflicted Mergify branches in place.

What is the problem this PR solves?

Release automation under dev-tools/mage/release had five issues:

  • Invalid PerPage keys in go-github composite literals (does not compile)
  • PR-A carried the backport-{branch} label while also bumping main to the next minor and adding the Mergify rule for that label, so merging PR-A could backport the next-minor bump onto the frozen line
  • finalizePR returned an existing open PR before pushing, so reruns could leave the remote tip behind after local prep commits
  • Feature freeze always called ensureLatestRelease, which fails for the first release of a new major and is unused by that workflow
  • Release-tracker updates replaced everything after ## PRs, wiping later sections and operator notes

How does this PR solve the problem?

  • Use nested ListOptions: github.ListOptions{PerPage: N} in GitHub list/search calls
  • Drop the backport label from PR-A labels (Mergify rule text still documents the label)
  • Push when the branch is ahead before reusing an open PR
  • Skip ensureLatestRelease in RunMajorMinorRelease (patch path unchanged)
  • Split the managed PR checklist from trailing markdown headings and keep the trailing text on updates

How to test this PR locally

go test ./dev-tools/mage/release/... ./dev-tools/mage/ -count=1

Design Checklist

  • N/A for release tooling (not fleet-server runtime / multi-instance agent path)

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool — skipped via skip-changelog (CI / release tooling)

Related issues

Use nested go-github ListOptions, drop the backport label from PR-A,
push before reusing open PRs, skip LatestRelease lookup on feature freeze,
and preserve release-tracker text after the managed PR list.
@fr4nc1sc0-r4m0n
fr4nc1sc0-r4m0n requested a review from a team as a code owner November 24, 2026 11:04
@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Nov 24, 2026
Copilot AI balanced review requested due to automatic review settings November 24, 2026 11:04
@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n self-assigned this Nov 24, 2026
@mergify

mergify Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @fr4nc1sc0-r4m0n? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@mergify

mergify Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

PR-A reruns retain a backport label that can send the next-minor bump onto a frozen release line, and managed-block regeneration still deletes operator notes.

2 open issues
What changed in this PR

This PR addresses follow-up fixes to Fleet Server’s Mage release automation, improving feature-freeze safety, rerun behavior, and release-tracker updates.

Changes:

  • Correct GitHub API pagination options and remove the backport label from newly created PR-A instances.
  • Push prepared commits before reusing open PRs and skip the unused latest-release lookup during feature freeze.
  • Preserve trailing level-two Markdown sections in release trackers and add regression assertions.
File Description
dev-tools/​mage/​release/​workflows.go Adjusts PR-A labels, feature-freeze initialization, and push ordering.
dev-tools/​mage/​release/​workflows_test.go Asserts PR-A excludes the release-branch backport label.
dev-tools/​mage/​release/​issue.go Separates the managed PR checklist from trailing sections.
dev-tools/​mage/​release/​issue_test.go Tests trailing-section preservation and repeat-update behavior.
dev-tools/​mage/​release/​github.go Fixes embedded pagination options in list and search requests.

Review effort: Balanced

Comment thread dev-tools/mage/release/workflows.go Resolved
Comment thread dev-tools/mage/release/issue.go Resolved
@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n added the backport-active-all Automated backport with mergify to all the active branches label Nov 24, 2026
… split

Remove leftover backport-* labels when reconciling PR-A, keep only the
PR checklist as the managed release-tracker block, and use promoted
PerPage fields so mage check:fix stays clean.
Copilot AI balanced review requested due to automatic review settings November 25, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The release package still cannot compile because pagination literals directly key the promoted PerPage field, and checklist regeneration can delete non-PR operator tasks.

2 open issues
2 resolved since last review

Review effort: Balanced

Draft bool
Reviewers []string
Labels []string
RemoveLabels []string // removed on create/reuse (e.g. leftover backport-* on PR-A)
}

func isManagedPRChecklistLine(trimmed string) bool {
if strings.HasPrefix(trimmed, "- [") {

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants